import request from '@/request/request'

// 分页获取拆卸单
export function getDisassemblyOrderPage(pageParams) {
    return request({
        method: "get",
        url: '/warehouse/disassembly/page',
        params: pageParams
    })
}

// 创建拆卸单
export function createDisassemblyOrder(disassemblyOrder) {
    return request({
        method: "post",
        url: '/warehouse/disassembly',
        data: disassemblyOrder
    })
}

// 获取拆卸单详情（包含明细）
export function getDisassemblyOrderWithDetails(id) {
    return request({
        method: "get",
        url: `/warehouse/disassembly/withDetails/${id}`,
    })
}

// 更新拆卸单
export function updateDisassemblyOrder(disassemblyOrder) {
    return request({
        method: "put",
        url: '/warehouse/disassembly',
        data: disassemblyOrder
    })
}

// 删除拆卸单
export function deleteDisassemblyOrder(id) {
    return request({
        method: "delete",
        url: `/warehouse/disassembly/${id}`,
    })
}

// 完成拆卸单
export function completeDisassemblyOrder(id) {
    return request({
        method: "put",
        url: `/warehouse/disassembly/complete/${id}`,
    })
}
